<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h2>测试webview跳转</h2>
    <div id="error"></div>
    <button id="app">跳转</button>
</body>
<script src="https://res.wx.qq.com/open/js/jweixin-1.3.0.js"></script>
   <script>
        var app = document.getElementById('app');
        var error = document.getElementById('error');
        app.onclick = function() {
            wx.miniProgram.switchTab({
                path: '/pages/index/index',
                appId: 'wxb61621e772a9f027',
                success: function() {
                    error.innerText = "success";
                },
                error: function(err) {
                    error.innerText = err;
                }
            });
        };
    </script>
</html>